<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport"
          content="width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" type="text/css" href="css/index.css">

    <script type="text/javascript">


    window.uexOnload = function(type){
        if(type == 0){  
            uexDemo.onViewButtonClick = function(){
                alert("onViewButtonClick");
            };
            uexDemo.onFragmentButtonClick = function(){
                alert("onFragmentButtonClick");
            };
        }
    };
    
    function openv(){
        var param = {
            time:3000
        };
        var result=uexDemo.test_vibrator(param);
        alert(result);
    }

    function showInputDialog(){
        var param = {
            defaultValue:'这是默认值'
        };
        uexDemo.test_showInputDialog(param,function (error, data) {
            if (!error){
                alert(data);
            }else{
                alert("用户取消了操作");
            }
        });
    }
    
    function addFragment(){
        var params = {
            left:100,
            top:200,
            width:400,
            height:400,
            isScrollWithWebView:true
        };
        uexDemo.test_addFragment(params);
    }

    function addView(){
        var params = {
            left:0,
            top:500,
            width:400,
            height:400,
            isScrollWithWebView:true
        };
        uexDemo.test_addView(params);
    }
    function test_startActivityForResult() {
        uexDemo.test_startActivityForResult(function (error, data) {
            if (!error){
                alert("返回结果是:"+data.result);
            }
        });
    }
</script>
</head>

<body>
    <div class="tit">uexDemo对象</div>
        <div class="conbor">
            <div class="consj">

                <span>1.test_startActivityForResult接口</span>
                <!--此接口将打开一个自定义的activity，并获取其操作后的返回值。-->
                <input class="btn" type="button" value="test_startActivityForResult"
                       onclick="test_startActivityForResult()"><br>

                <span>2.test_vibrator接口</span>
                <!--此接口将调用设备的震动，需输入震动时间，单位为毫秒-->
                <input class="btn" type="button" value="test_vibrator"
                       onclick="openv();"><br>

                <span>3.test_showInputDialog接口</span>
                <!--此接口将打开一个自定义的输入框，并获取其操作后的返回值。-->
                <input class="btn" type="button" value="test_showInputDialog"
                       onclick="showInputDialog();"><br>

                <span>4.test_addFragment接口</span>
                <!--此接口将打开一个自定义的FragmentView添加到当前屏幕上。-->
                <input class="btn" type="button" value="test_addFragment" onclick="addFragment();"><br>

                <span>5.test_removeFragment接口</span>
                <!--此接口将从屏幕上移除刚刚打开的FragmentView。-->
                <input class="btn" type="button" value="test_removeFragment"
                       onclick="uexDemo.test_removeFragment();"><br>

                <span>6.test_addView接口</span>
                <!--此接口将打开一个自定义的View添加到当前屏幕上。-->
                <input class="btn" type="button" value="test_addView" onclick="addView();"><br>

                <span>7.test_removeView接口</span>
                <!--此接口将从屏幕上移除刚刚打开的自定义View。-->
                <input class="btn" type="button" value="test_removeView"
                       onclick="uexDemo.test_removeView();"><br>
            </div>
        </div>
    </div>
</body>
</html>
